package com.sina.finance.api.framework.permission.realm;

import org.apache.shiro.authc.AuthenticationToken;

import java.util.Map;


public class StatelessToken implements AuthenticationToken {

    private String appKey;
    private String partnerCode;
    private Map<String, String[]> params;
    private String clientDigest;

    public StatelessToken(String appKey, String partnerCode, Map<String, String[]> params, String clientDigest) {
        this.appKey = appKey;
        this.partnerCode = partnerCode;
        this.params = params;
        this.clientDigest = clientDigest;
    }

    public String getPartnerCode() {
        return partnerCode;
    }

    public void setPartnerCode(String partnerCode) {
        this.partnerCode = partnerCode;
    }

    public  Map<String, String[]> getParams() {
        return params;
    }

    public void setParams( Map<String, String[]> params) {
        this.params = params;
    }

    @Override
    public Object getPrincipal() {
       return appKey;
    }

    @Override
    public Object getCredentials() {
        return clientDigest;
    }

    public String getAppKey() {
        return appKey;
    }

    public String getClientDigest() {
        return clientDigest;
    }
}
